package com.lysj.food.food.controller;

import com.lysj.admin.utils.spring.foundation.base.BaseController;
import com.lysj.admin.utils.validation.annotation.Valid;
import com.lysj.admin.utils.web.Resp;
import com.lysj.food.food.domain.FoodAttribute;
import com.lysj.food.food.domain.FoodAttributeDetail;
import com.lysj.food.food.service.FoodAttributeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Created by wtl on 2019-03-19 16:00:45
 * @description 菜品属性控制层
 */
@Slf4j
@RestController
@RequestMapping("/food/food_attribute")
public class FoodAttributeController extends BaseController<FoodAttribute> {

    @Resource
    private FoodAttributeService foodAttributeService;

    @Override
    public FoodAttributeService getService() {
        return foodAttributeService;
    }

    /**
     * @author Created by wtl on 2019/3/19 19:35
     * @Description 获取菜品属性
     */
    @GetMapping("/find_food_attribute")
    public Resp findFoodAttribute(String storeId, String foodAttributeId) {
        return new Resp().success(foodAttributeService.findFoodAttrList(storeId, foodAttributeId));
    }

    /**
     * @author Created by wtl on 2019/4/3 16:46
     * @Description 根据门店id获取菜品属性列表
     */
    @GetMapping("/find_store_food_attribute")
    public Resp findStoreFoodAttribute(String storeId) {
        return new Resp().success(foodAttributeService.findStoreFoodAttribute(storeId));
    }


}
